package menu

import (
	"fmt"
	"github.com/go-playground/validator/v10"
)

const (
	AppName = "menu"
)

var (
	validate = validator.New()
)

func NewMenuRole(req *CreateMenuRequest) (*MenuRole, error) {
	fmt.Println(req)
	menu, err := JsonToStruct()
	if err != nil {
		return nil, err
	}
	return menu, nil
}

func NewNillMenuRole() *MenuRole {
	return &MenuRole{}
}

func (req *CreateMenuRequest) Validate() error {
	return validate.Struct(req)
}

func NewCreateMenuRequest() *CreateMenuRequest {
	return &CreateMenuRequest{}
}

func NewDefaultMenuRole() (*MenuRole, error) {
	return NewMenuRole(NewCreateMenuRequest())
}
